<template>
  <el-container>This is an about page</el-container>
  <el-button @click="message1">message</el-button>
  <el-button @click="test1">test</el-button>
  <el-button @click="alert">alert</el-button>
</template>
<script>
import api from '../api/api'
export default {
  methods: {
    message1() {
      this.$message.error("1")
    },
    test(){
      api.test({id:1}).then(
        res => console.log(res));
    },
    test1(){
      api.loginStateUpdate().then(
        res => {
          if(res!=true){
            this.$router.push({path: '/LoginExpiredView'})
          }else{
            console.log("更新状态成功")
          }
        });
    },
    alert(){
      this.$alert('这是一段内容', '标题名称', {
          confirmButtonText: '确定',
          // center: true,
          type: 'warning',
          callback: action => {
            this.$message({
              type: 'info',
              message: `action: ${ action }`
            });
          }
        });
    }
    
  }
}
</script>

